package ServerDB;

import ServerDB.MapFileServer;

import org.hibernate.Session;
/**
 * Manager of Files in DB
 * @author Guy & Liel
 *
 */
public class MapFileServerManager
{
	private Session session=null;
	
	/**
	 * constructor MapFileServerManager
	 * @param session
	 */
	public MapFileServerManager(Session session)
	{
		if(session==null)
		{
			throw new RuntimeException("Invalid session object");
		}
		this.session=session;
	}
	/**
	 * Save a new file
	 * @param mfs
	 */
	public void saveMFS(MapFileServer mfs)
	{
		session.save(mfs);
	}
	/**
	 * update an exist file
	 * @param mfs
	 */
	public void updateMFS(MapFileServer mfs)
	{
		session.update(mfs);
	}
	/**
	 * delete file from DB
	 * @param mfs
	 */
	public void deleteMFS(MapFileServer mfs)
	{
		session.delete(mfs);
	}
}
